﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Negocio
{
    public class NgBase<T>
    {
        object contexto = null;

        protected T Contexto
        {
            get
            {
                if ( contexto == null )
                {
                    contexto = Activator.CreateInstance( typeof( T ), new object[] 
                           {
                               ConfigurationManager.ConnectionStrings["cinemaContext"].ConnectionString
                           } );
                }

                return ( T )contexto;
            }
        }
    }
}
